/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sevent.util;

import java.security.MessageDigest;
import java.sql.Timestamp;

/**
 *
 * @author enriquer
 */
public final class Util {

    private Util() {
    }
    
    public static Timestamp convert(String s){
        return null;
    }

    public static String md5(String clear) throws Exception {
        MessageDigest md = MessageDigest.getInstance("MD5");
        byte[] b = md.digest(clear.getBytes());

        int size = b.length;
        StringBuffer h = new StringBuffer(size);
        for (int i = 0; i < size; i++) {
            int u = b[i] & 255;
            if (u < 16) {
                h.append("0" + Integer.toHexString(u));
            } else {
                h.append(Integer.toHexString(u));
            }
        }
        return h.toString();
    }
}
